<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
 <!DOCTYPE html>
<html>

<head>
	<base href="/">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    

    <title>充值明细</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico"> 
    <link href="static/templet/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="static/templet/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="static/templet/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="static/templet/css/animate.min.css" rel="stylesheet">
    <link href="static/templet/css/style.min862f.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
    <form action="recharge/list" method="post" id="rechargeForm">
        <div class="row">      
            <div class="col-sm-12">
        		<table class="table table-hover">
        			<tr>
        				<td>
							 <input value="${param.userName}" name="userName" class="form-control" placeholder="请输入用户名">
        				</td>
        				<td>
        					<select class="form-control" name="type" id="type" data-placeholder="搜索引擎">
					            <option value="">充值类型</option>
					            <option value="unionpay" <c:if test="${param.type == 'unionpay'}">selected</c:if>>银联</option>
					            <option value="alipay" <c:if test="${param.type == 'alipay'}">selected</c:if>>支付宝</option>
					            <option value="wechat" <c:if test="${param.type == 'wechat'}">selected</c:if>>微信</option>
					        </select>
        				
        				</td>
        				<c:if test="${'01' eq userType }">
        				<td>
        					<select class="form-control" name="belongId" id="belongId" data-placeholder="搜索引擎">
					            <option value="">业务员</option>
					            <c:forEach items="${sysUserList }" var="sysUser">
					            <option value="${sysUser.id}" <c:if test="${param.belongId == sysUser.id }">selected</c:if>>${sysUser.loginName}</option>
					            </c:forEach>
					            
					        </select>
        				</td>
        				
        				</c:if>
        				<td>
        					<input placeholder="开始日期" class="form-control layer-date" readonly="readonly" id="startTime" name="startTime" value="${param.startTime }">
        				</td>
        				<td>
                            <input placeholder="结束日期" class="form-control layer-date" readonly="readonly" id="endTime" name="endTime" value="${param.endTime }">
        				</td>
        				<td>
        					<button type="button" class="btn btn-primary" onclick="searchs();">检索</button>
        				</td>
        			</tr>
        		</table>
			</div>     
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                    	<a class="btn btn-primary " href="javascript:add();" target="_self">新增</a>
                        <table class="table table-hover">
                            <thead>
                                <tr>
                                	<th>序号</th>
                                    <th>用户名</th>
                                    <th>支付方式</th>
                                    <th>金额</th>
                                    <th>时间</th>
                                    <th>备注</th>
                                </tr>
                            </thead>
                            <tbody>
                            <c:choose>
                            	<c:when test="${result.state eq '1' }">
                            		<c:forEach items="${page.list}" var="recharge" varStatus="vs">
                            			<tr>
		                                    <td>${recharge.id }</td>
											<td>${recharge.userName }</td>
											<td>${recharge.typeName }</td>
											<td>${recharge.money }</td>
											<td>${recharge.rechargeTime }</td>
											<td>${recharge.remark }</td>
                                		</tr>
                            		
                            		</c:forEach>
                            	</c:when>
                            	<c:otherwise>
                            		<tr>
                            			<td>${result.message }</td>
                            		</tr>
                            	</c:otherwise>
                            </c:choose>
                            </tbody>
                        </table>
                        
                        <jsp:include page="/WEB-INF/jsp/page.jsp">
                        	<jsp:param value="rechargeForm" name="form"/>
                        </jsp:include>
                    </div>
                </div>
            </div>
        </div>
        </form>
    </div>
    <script src="static/templet/js/jquery.min.js?v=2.1.4"></script>
    <script src="static/templet/js/bootstrap.min.js?v=3.3.5"></script>
    <script src="static/templet/js/plugins/peity/jquery.peity.min.js"></script>
    <script src="static/templet/js/plugins/layer/layer.min.js"></script>
    <script src="static/templet/js/iframe.min.js"></script>
    <script src="static/templet/js/plugins/layer/laydate/laydate.js"></script>
    <script type="text/javascript">
    
    function searchs(){
    	$("#rechargeForm").submit();
    }
    
    function add(){
    	parent.layer.open({
    	    type: 2,
    	    title: '用户',
    	    shadeClose: true,
    	    shade: 0.8,
    	    area: ['50%', '80%'],
    	    content: 'recharge/add',
    	    cancel:function(index, layero){
    	    	iframe.get(layero);
    	    	if(result == 1){
    	    		location.reload(true);
    	    	}
    	    	
    	    }
    	});
    }
    var start={elem:"#startTime",format:"YYYY-MM-DD hh:mm:ss",min:"1970-01-11 00:00:00",max:"2099-06-16 23:59:59",istime:true,istoday:false,choose:function(datas){end.min=datas;end.start=datas}};var end={elem:"#endTime",format:"YYYY-MM-DD hh:mm:ss",min:"1970-01-11 00:00:00",max:"2099-06-16 23:59:59",istime:true,istoday:false,choose:function(datas){start.max=datas}};laydate(start);laydate(end);
    </script>

</body>

</html>